package application.client.gui.components;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import application.controller.client.GuiController;

import middleware.datacontainer.groupPropertiesChange.GroupPropertiesContainer;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class MessageTab extends JPanel{
		
	private HashMap<GroupPropertiesContainer, GroupSettingPanel> groups = new HashMap<GroupPropertiesContainer,GroupSettingPanel>();
	private JButton messageButton;
	
	//messageTabpanel
	private JPanel info;
	private JPanel messageResultPanel;
	private JScrollPane messageResutlPane;
	private JTable messageTable;
	private String[][] messageDataArray;
	private String[] messageTableHeader = {"ID","Message"};
	private int actualIndex=0;
	private JTextArea message;
	
	public MessageTab()
	{
		super(true);
		init();
	}
	private void init()
	{
		this.setLayout(new BorderLayout());
		this.setBackground(new java.awt.Color(255,255,255));		
		
		{
			info = new JPanel();
			info.setLayout(new FlowLayout());
			this.add(info, BorderLayout.CENTER);
			info.setBackground(new java.awt.Color(255,255,255));
			info.setBorder(BorderFactory.createTitledBorder("Exemplars"));
			{
				messageResultPanel = new JPanel();
				BorderLayout exemplarResultPanelLayout = new BorderLayout();
				messageResultPanel.setLayout(exemplarResultPanelLayout);
				info.add(messageResultPanel);
				messageResultPanel.setPreferredSize(new java.awt.Dimension(657, 339));
				messageResultPanel.setBackground(Color.white);
				{
					JLabel messageDes = new JLabel("Message: ");
					messageDes.setAlignmentX(0.5f);
					messageDes.setText("Message:");
					messageResultPanel.add(messageDes, BorderLayout.WEST);
					messageDes.setVerticalAlignment(SwingConstants.TOP);

					message = new JTextArea();
					messageResultPanel.add(message, BorderLayout.CENTER);					
				}
			}		
		}		
		
		JPanel dummyPanelR = new JPanel();
		add(dummyPanelR, BorderLayout.EAST);
		dummyPanelR.setBackground(new java.awt.Color(255,255,255));
		dummyPanelR.setPreferredSize(new java.awt.Dimension(17, 380));
		this.add(new ImagePanel(), BorderLayout.SOUTH);
	}
	public void addMessage(String pmessage)
	{
		System.out.println("message in tab "+pmessage);
		message.append(pmessage);
		message.append("\n");
	}
	
}
